package com.scrumtrek.trainings.tdd;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: neee
 * Date: 12.09.13
 * Time: 10:41
 * To change this template use File | Settings | File Templates.
 */
public class StubStore implements IStore<Book>{

    private List<Book> items = new ArrayList<Book>();
    IPaySystem iPaySystem;

    public void addItem(Book item) {
        items.add(item);
    }

    public void removeItem(Book item) {
        items.remove(item);
    }

    public List<Book> getItems() {
        return items;
    }

    public void sell(Book item) {
        iPaySystem.increaseProfit(item.getPrice());
        removeItem(item);
    }

    public void setIPaySystem(IPaySystem iPaySystem) {
        this.iPaySystem = iPaySystem;
    }


}
